<template>
  <view class="container">
    <!-- 顶部组件 -->
    <u-navbar
      id="nav-bar"
      :is-back="true"
      :background="{ background: '#fff' }"
      :border-bottom="false"
      title="欠款明细"
    ></u-navbar>
    <view class="content">
      <u-tabs
        :list="tabList"
        :is-scroll="false"
        :current="tabCurrent"
        @change="changeTab"
      ></u-tabs>

      <view class="main-header">
        <view v-if='tabCurrent === 0' class="item">
          <view class="header">
            <view class="left">
            <image class="avatar" src="/static/images/logo.png" mode="widthFix"></image>
            <view class="info">
              <view class="name">张三三</view>
              <view class="phone">18888888888</view>
            </view>
          </view>
          </view>
          <view class="dataShow">
            <view class="data">
              <view class="value">12012392.83</view>
              <view class="label">已还款金额</view>
            </view>
            <view class="data">
              <view class="value">1231.12</view>
              <view class="label">未还款金额</view>
            </view>
            <view class="data">
              <view class="value">4192837.17</view>
              <view class="label">总欠款金额</view>
            </view>
          </view>
        </view>
        <view v-else class="item">
          <view class="header">
            <view class="left">
              <text class="left-name">放款时间:2024-01-05 12:12:31</text>
            </view>
          </view>
          <view class="dataShow">
            <view class="data">
              <view class="value">12012392.83</view>
              <view class="label">已还款金额</view>
            </view>
            <view class="data">
              <view class="value">1231.12</view>
              <view class="label">未还款金额</view>
            </view>
            <view class="data">
              <view class="value">4192837.17</view>
              <view class="label">总欠款金额</view>
            </view>
          </view>
        </view>
      </view>

      <view class="titleBox">
        <text>收益明细</text>
        <image
          class="title-sign"
          src="/static/images/icon-tzgg.png"
          mode="widthFix"
        ></image>
      </view>

      <view class="list">
        <view class="item">
          <view class="info">
            <view class="title">展业还款</view>
            <view class="time">2024-26-07 14:32:21</view>
          </view>
          <view class="num">+0</view>
        </view>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  data() {
    return {
      tabList: [
        {
          name: '展业欠款',
          count: 0,
        },
        {
          name: '创业欠款',
          count: 0,
        },
      ],
      tabCurrent: 0,
    };
  },
  onLoad() {},
  methods: {
    navigateTo(url) {
      uni.navigateTo({
        url: url,
      });
    },
    changeTab(index) {},
  },
};
</script>

<style lang="scss" scoped>
.container {
  width: 100%;
  min-height: 100vh;
  padding: 0 0 60rpx;
  text-align: center;
  background-color: #f5f5f5;
}

.content {
  position: relative;
  width: 100%;
}

.main-header {
  width: 100%;
  padding: 30rpx 30rpx 0;
  overflow: hidden;
  .item {
    float: left;
    margin-bottom: 30rpx;
    width: 100%;
    padding: 30rpx;
    background: #ffffff;
    border-radius: 20rpx;
    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      .left {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        .avatar {
          width: 98rpx;
          height: 98rpx;
          border-radius: 50%;
        }
        .info {
          padding-right: 20rpx;
          text-align: left;
          line-height: 1;
          .name {
            font-weight: 800;
            font-size: 28rpx;
            color: #333333;
          }
          .phone {
            margin-top: 20rpx;
            font-family: DIN;
            font-weight: bold;
            font-size: 32rpx;
            color: #333333;
          }
        }
        .left-name {
          margin-left: 15rpx;
          font-weight: bold;
          font-size: 28rpx;
          color: #333333;
        }
      }
    }
    .dataShow {
      display: flex;
      justify-content: space-between;
      margin-top: 30rpx;
      width: 100%;
      padding: 30rpx;
      background: #f7f7f7;
      border-radius: 16rpx;
      .data {
        flex: 1;
        min-width: 0;
        text-align: center;
        .value {
          font-family: DIN, sans-serif;
          font-weight: bold;
          font-size: 32rpx;
          color: #333333;
        }
        .label {
          margin-top: 12rpx;
          font-weight: 400;
          font-size: 24rpx;
          color: #999999;
        }
      }
    }
  }
}

.titleBox {
  position: relative;
  width: 100%;
  padding: 0 30rpx;
  text-align: left;
  text {
    position: relative;
    font-weight: 800;
    font-size: 28rpx;
    color: #333333;
    z-index: 9;
  }
  .title-sign {
    position: absolute;
    top: -10rpx;
    left: 120rpx;
    width: 32rpx;
    height: auto;
    z-index: 1;
  }
}

.list {
  width: 100%;
  padding: 30rpx;
  .item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: auto;
    padding: 30rpx;
    background: #ffffff;
    border-radius: 16rpx;
    .info {
      flex: 1;
      min-width: 0;
      text-align: left;
      .title {
        margin-left: 10rpx;
        font-weight: 800;
        font-size: 28rpx;
        color: #333333;
      }

      .time {
        margin-top: 24rpx;
        width: 100%;
        font-family: PingFang SC, sans-serif;
        font-weight: 400;
        font-size: 24rpx;
        color: #999999;
        text-align: left;
      }
    }
    .num {
      font-weight: 800;
      font-size: 28rpx;
      color: #f03434;
    }
  }
}
</style>
